﻿using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.ComponentModel;

namespace Core.Forms
{
    public class Register
    {
        [Required(ErrorMessageResourceName = "RequiredField", ErrorMessageResourceType = typeof(TheResources.Global))]
        [Display(ResourceType = typeof(TheResources.Global), Name = "UserName")]
        public string UserName { get; set; }

        [Display(ResourceType = typeof(TheResources.Global), Name = "Password")]
        [Required(ErrorMessageResourceName = "RequiredField", ErrorMessageResourceType = typeof(TheResources.Global))]
        [StringLength(255, MinimumLength = 6, ErrorMessageResourceType = typeof(TheResources.Global), ErrorMessageResourceName = "MinLength")]
        public string Password { get; set; }

        [Display(ResourceType = typeof(TheResources.Global), Name = "RepeatPassword")]
        [Required(ErrorMessageResourceName = "RequiredField", ErrorMessageResourceType = typeof(TheResources.Global))]
        [Compare("Password", ErrorMessageResourceName = "InvalidComparePassword", ErrorMessageResourceType = typeof(TheResources.Global))]
        public string RepeatPassword { get; set; }

        [Display(ResourceType = typeof(TheResources.Global), Name = "Names")]
        [Required(ErrorMessageResourceName = "RequiredField", ErrorMessageResourceType = typeof(TheResources.Global))]
        public string GivenName { get; set; }

        [Display(ResourceType = typeof(TheResources.Global), Name = "LastNames")]
        [Required(ErrorMessageResourceName = "RequiredField", ErrorMessageResourceType = typeof(TheResources.Global))]
        public string SurName { get; set; }

        [Display(ResourceType = typeof(TheResources.Global), Name = "Email")]
        [Required(ErrorMessageResourceName = "RequiredField", ErrorMessageResourceType = typeof(TheResources.Global))]
        [RegularExpression(TheResources.RegexUtilities.EmailRegexPattern, ErrorMessageResourceName = "InvalidEmail", ErrorMessageResourceType = typeof(TheResources.Global))]
        public string Email { get; set; }
    }
}
